package com.jjy.admin.mapper;

import com.jjy.common.core.BaseMapperX;
import com.jjy.common.core.LambdaQueryWrapperX;
import com.jjy.common.domain.PageResult;
import com.jjy.admin.domain.JobEntity;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public interface JobMapper extends BaseMapperX<JobEntity> {

    default PageResult<JobEntity> selectPage(JobEntity jobEntity) {

        return selectPage(new LambdaQueryWrapperX<JobEntity>()
        .eqIfPresent(JobEntity::getProvince,jobEntity.getProvince())
         .eqIfPresent(JobEntity::getCity,jobEntity.getCity())
         .eqIfPresent(JobEntity::getDegree,jobEntity.getDegree())
         .eqIfPresent(JobEntity::getIndustryType1,jobEntity.getIndustryType1())
                .likeIfPresent(JobEntity::getExperience,jobEntity.getExperience())
                        .likeIfPresent(JobEntity::getJobName,jobEntity.getJobName())
        );

    }

    default List<JobEntity> selectList(JobEntity jobEntity) {

        return selectList(new LambdaQueryWrapperX<JobEntity>()
                .eqIfPresent(JobEntity::getProvince,jobEntity.getProvince())
                .eqIfPresent(JobEntity::getCity,jobEntity.getCity())
                .eqIfPresent(JobEntity::getDegree,jobEntity.getDegree())
                .eqIfPresent(JobEntity::getIndustryType1,jobEntity.getIndustryType1())
                .likeIfPresent(JobEntity::getExperience,jobEntity.getExperience())
                .likeIfPresent(JobEntity::getJobName,jobEntity.getJobName())
        );

    }


    Long selectAddCount();

    List<Map> getConfigData();

    ArrayList<JobEntity> selectByKeyWord();

    void insertGiftWord(@Param("giftWord")String giftWord);

    List<String> getGiftWords();
    List<String> getSalaryByExperience();
    List<String> getExperienceByExperience();

    List getConeData();
}
